package MainPackage 
{
	import asunit.framework.TestCase;
  import MainPackage.events.RadioEvent;
	
	/**
   * ...
   * @author Roman Marchenko
   */
  public class TestRadio extends TestCase 
  {
    
    public function TestRadio(testMethod:String = null) 
    {
      super(testMethod);
    }
    
    public function testRadio (): void 
    {
      var radio: Radio = new Radio;
      var handler: Function = function (event: RadioEvent): void
      {
        assertNotNull(event.artist);
        assertNotNull(event.song);
        assertEquals("Guns N' Roses", radio._title);
      }
      
      radio.addEventListener(RadioEvent.TRACK_UPDATE, addAsync(handler, 10000)); 
      radio.play("Guns and Roses");
    }
  }

}